package com.zcxy360.sandtable.exception;


import org.apache.shiro.authc.AuthenticationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.validation.BindException;
import org.springframework.web.HttpMediaTypeNotSupportedException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;

//@RestControllerAdvice
public class MyExceptionHandler {

    /**
     * 500- 服务器内部错误
     */
    @ExceptionHandler(Exception.class)
    public Object handleException(Exception e) {
    	if(e instanceof AuthenticationException){
    		 return e.getMessage();
    	}
        e.printStackTrace();
        return e.getMessage();
    }
}
